<!DOCTYPE HTML>
<html>
<head>
<#include "/adminPage/common.html"/>
<style type="text/css">
</style>
</head>
<body class="layui-layout-body">
	<div class="layui-layout layui-layout-admin">

		<#include "/adminPage/header.html"/>
		<#include "/adminPage/menu.html"/>

		<div class="layui-body">
			<!-- 内容主体区域 -->
			<div style="padding: 15px">
				<fieldset class="layui-elem-field layui-field-title">
					<legend>项目管理</legend>
				</fieldset>

				<form action="${ctx}/adminPage/project" id="searchForm" method="post" >
					<div class="layui-form search">
						<button type="button" class="layui-btn layui-btn-normal" onclick="add()">添加项目</button>
					</div>

					<input type="hidden" name="pageNum" value="${page.pageNum}">
				</form>

			<table class="layui-table">
				<thead>
					<tr>
						<th>项目名</th>
						<th>参与人</th>
						<th>状态</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<#list page.records as projectResp>
					<tr>
						<td>${projectResp.name}</td>
						<td>${projectResp.userNames}</td>
						<td>
						
							<#if projectResp.status == 0>
								<span class="green">正常</span>
							</#if>
							<#if projectResp.status == 1>
								<span class="red">禁用</span>
							</#if>
						</td>
						<td>
							<div class="layui-inline">
							<button class="layui-btn layui-btn-sm" onclick="edit('${projectResp.id}')">编辑</button>
							</div>
							<div class="layui-inline">
							<button class="layui-btn layui-btn-danger layui-btn-sm" onclick="del('${projectResp.id}')">删除</button>
							</div>
						</td>
					</tr>
					</#list>
				</tbody>
			</table>

			<div id="pageInfo"></div>
		</div>
	</div>
	</div>

	<div style="height: 0px; width: 0px; overflow: hidden;">
		<!-- 弹出框 -->
		<div class="layui-form" id="windowDiv" style="padding: 15px; display: none">
			<form id="addForm">
				<input type="hidden" name="id" id="id">
					
				<div class="layui-form-item">
					<label class="layui-form-label">项目名<span class="red">*</span></label>
					<div class="layui-input-block">
						<input type="text" name="name" id="name" class="layui-input">
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">参与者<span class="red">*</span></label>
					<div class="layui-input-block">
						<#list userList as user >
							 <input type="checkbox" name="userIds" id="users_${user.id}" value="${user.id}"  lay-skin="primary" title="${user.trueName}">
						</#list>
					</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label">状态</label>
					<div class="layui-input-block">
						<select name="status" id="status">
							<option value="0" >正常</option>
							<option value="1" >禁用</option>
						</select>
					</div>
				</div>

				<div class="layui-form-item center">
					<button type="button" class="layui-btn layui-btn-normal" onclick="addOver()">提交</button>
					<button type="button" class="layui-btn" onclick="layer.closeAll()">关闭</button>
				</div>
			</form>
		</div>

	</div>

	<script src="${ctx}/js/adminPage/project/index.js?v=${jsrandom}" type="text/javascript"></script>
</body>


</html>